import 'package:common_lib/common_lib.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class ComponentList extends StatefulWidget {
  ComponentList({Key key}) : super(key: key);

  @override
  _ComponentListState createState() => _ComponentListState();
}

class _ComponentListState extends State<ComponentList> {
  @override
  void initState() {
    super.initState();
  }

  final moduleList = ["患者管理"];

  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(title: Text("组件列表"), actions: <Widget>[]),
        backgroundColor: Colors.white,
        body: ListView.separated(
            itemCount: moduleList.length,
            itemBuilder: (BuildContext context, int index) {
              return GestureDetector(
                  onTap: () => {
                        if (moduleList[index] == "患者管理")
                          {CommonLib.jumpPatientManagement(context)}
                      },
                  child: ListTile(
                    title: Text(moduleList[index]),
                    trailing: Icon(Icons.arrow_forward_ios),
                  ));
            },
            //分割器构造器
            separatorBuilder: (context, index) => Divider(height: .0)));
  }
}
